{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import sympy as sym\n",
    "from sympy.polys.multivariate_resultants import MacaulayResultant\n",
    "\n",
    "sym.init_printing()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Macaulay Resultant\n",
    "------------------"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The Macauly resultant is a multivariate resultant. It is used for calculating the resultant of $n$ polynomials\n",
    "in $n$ variables. The Macaulay resultant is calculated as the determinant of two matrices,\n",
    "\n",
    "$$R = \\frac{\\text{det}(A)}{\\text{det}(M)}.$$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Matrix $A$\n",
    "-----------"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "There are a number of steps needed to construct matrix $A$. Let us consider an example from https://dl.acm.org/citation.cfm?id=550525 to \n",
    "show the construction."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x, y, z = sym.symbols('x, y, z')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a_1_1, a_1_2, a_1_3, a_2_2, a_2_3, a_3_3 = sym.symbols('a_1_1, a_1_2, a_1_3, a_2_2, a_2_3, a_3_3')\n",
    "b_1_1, b_1_2, b_1_3, b_2_2, b_2_3, b_3_3 = sym.symbols('b_1_1, b_1_2, b_1_3, b_2_2, b_2_3, b_3_3')\n",
    "c_1, c_2, c_3 = sym.symbols('c_1, c_2, c_3')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "variables = [x, y, z]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "f_1 = a_1_1 * x ** 2 + a_1_2 * x * y + a_1_3 * x * z + a_2_2 * y ** 2 + a_2_3 * y * z + a_3_3 * z ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "f_2 = b_1_1 * x ** 2 + b_1_2 * x * y + b_1_3 * x * z + b_2_2 * y ** 2 + b_2_3 * y * z + b_3_3 * z ** 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "f_3 = c_1 * x + c_2 * y + c_3 * z"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "polynomials = [f_1, f_2, f_3]\n",
    "mac = MacaulayResultant(polynomials, variables)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Step 1** Calculated $d_i$ for $i \\in n$. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGMAAAAUBAMAAABrMp7fAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAdt3NMolEIpm7EKvvVGZvmWXoAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABGUlEQVQoFZWSsU/CQBSHfwVqSaHEsOjYEFhwkBh3GB1ZMG70P9CwwNgRwsriVmcGiKMxahgJO4z+DQIOLMdBEe7eKya87b4v370bDtlbnDKZGw/3QKvTY5XVfq4wuAHmJrGHqHtU92H+UgZnvEtSAdJfVL8BE8r63dUuSbtILageAZ8VCo2/JL6KSMrBf4m8KyZzNtcBRfstUjxWqQXOloypyRWzcvOQQSVJ+swCbc6U5JJbGBHXHBLHR5NFM1hPFB6SO+CC2oQP43hiFWpd157rUaP28IpBSYf7LXEhhItcoOmyED+IFTWWfJ9/hN8yxA57huRTLdketj85xCa3QJVDJXnhFvY5h0ryzS0yEUwm2XwEP46MnLcGoZlHCf5KLDEAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$\\left [ 2, \\quad 2, \\quad 1\\right ]$$"
      ],
      "text/plain": [
       "[2, 2, 1]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.degrees"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "**Step 2.** Get $d_M$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAOBAMAAADkjZCYAAAAKlBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADmU0mKAAAADXRSTlMAIom7VJlmdt1E7xDNIS4hGwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAFJJREFUCB1jYBBSMmFgYAxg8E1gYL/CwNvAwLmSYe8BBiAAijAwcDcBCUaNaCDJwKA1AURyrWZgFGBgBiq+DSK5DBg4LjKwJTD4FjAwTA21ZAAAM4UOK1ZklQ8AAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$3$$"
      ],
      "text/plain": [
       "3"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.degree_m"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "**Step 3.** All monomials of degree $d_M$ and size of set."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "mac.get_monomials_set()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KG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PsbzaEnggfwNJ/A7PDhgCQ4b8E3GqBmXVWeHBvAvR3Yf4lheuIoJqQVDEYi1hZ2YWLF5zQCOBmTvNnE2jnQPrk/tSfCaYUgvBoA2iNezzl2BmSMPi3KcqEiMWDYUAklLdiSCJh2g0WjewY3DPBbnURssblpfBuf5BvEONG5KMC9OWJKTK4nYcrKhEEhavR+adBIczRfmG+xZBGxpZxegkeHhwkU4yih4uL0Fiwo+CkYrvHI1YklOriSCxSRDDIhatR+KPYkdTXpnYbc+RpLcxkuxrG8+Cs/SpruU3gIdf/v+eycUvA3rZcURo/zMpOhrr7krJHgeYkBD5UAyZX4bMnbUqg7gp+HklbPDD7AJQC/LA7ycWl25QW8LkleH5o82Kt5q/bmm4FMbv/apqKhGjPLa45RGa+6KCtujEOeGSoFkClw/7MOqunbeLwqYCPSjmmK2moe7DNtsRb2TV6rAIH6AyLXmwrE1hC8VII26FnZkMZ2aNf8JNds3ZxELLsMZc1uomLIlvDhJij+EVWAYsZ5sG2IyhCkqQBp29ewg1Zvy0axQfrw+BUfMoYpJIOHaeGGQl6vASZEXd7cnDJOhUkB1wq6eHcSsKklw5aMZeywIrwynZq9iypVwuvpLUagCt4o8+cowGbKpKqA6YVfPDmImJgmufDQeutfD+6NR74D7oykZTa/4P5Sac0+CtPfE//bDgtyc5ulCAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$$\\left [ x^{3}, \\quad x^{2} y, \\quad x^{2} z, \\quad x y^{2}, \\quad x y z, \\quad x z^{2}, \\quad y^{3}, \\quad y^{2} z, \\quad y z^{2}, \\quad z^{3}\\right ]$$"
      ],
      "text/plain": [
       "⎡ 3   2     2       2            2   3   2       2   3⎤\n",
       "⎣x , x ⋅y, x ⋅z, x⋅y , x⋅y⋅z, x⋅z , y , y ⋅z, y⋅z , z ⎦"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.monomial_set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAABMAAAAPBAMAAAD0aukfAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAVO8Qq5l2zWaJMt0iu0SCRuA9AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAcUlEQVQIHWNgAAHmyM4FQIpRmYGBXYB5DwODSchnBoYmBobpQFE2IPMKA4O8AYT5hYHhvQCYyfwVyEwAM3l+MjCsnwBhAkWhTCQFDEBt8hBtDHcZGPqhhgGtCIdawS3ArMXAwOr03YOBeVrKAqAoHAAARgMh+ZrNuUcAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$10$$"
      ],
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.monomials_size"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "These are the columns of matrix $A$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "**Step 4** Get rows and fill matrix."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeAAAAAbBAMAAABW2EHIAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAu90ids0yiUQQq2ZUme/cMhILAAAACXBIWXMAAA7EAAAOxAGVKw4bAAADlUlEQVRYCeVYTWgTQRh9+TG726ZapRd7UbYtVgsSb6KioQSkQmy8eYyCJw8N6EHx4FJ68tIVAkIvDah4DaJ4EKXiSfGnBSuIiD0o6MmCP1gU6szOJjt/Wdiwi4cMtLv73nzvey+zs2kX6IVhrLzrhZhBxgu43b7YYR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",
      "text/latex": [
       "$$\\left [ \\left [ x, \\quad y, \\quad z\\right ], \\quad \\left [ x, \\quad y, \\quad z\\right ], \\quad \\left [ x y, \\quad x z, \\quad y z, \\quad z^{2}\\right ]\\right ]$$"
      ],
      "text/plain": [
       "⎡                      ⎡                2⎤⎤\n",
       "⎣[x, y, z], [x, y, z], ⎣x⋅y, x⋅z, y⋅z, z ⎦⎦"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.get_row_coefficients()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Each list is being multiplied by polynomials $f_1$, $f_2$ and $f_3$ equivalently. Then we fill the matrix\n",
    "based on the coefficient of the monomials in the columns."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAegAAAD5CAMAAADbc1a0AAAAP1BMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADFBd4eAAAAFHRSTlMAMquZdlQQQO0wRCKJ781mu918bN6TUK4AAAAJcEhZcwAADsQAAA7EAZUrDhsAABl9SURBVHgB7V3tgqq6smTUcZ8z43zd6/s/60mASgJ0Qxckiuz4YzVCV7o6paizKtC83dvHqamPQ87AX6dv07zdzxf3eD9kl7Wp5sere7p7od/qdBx9Bn6q0Bskvp5vPzfqXUIjcgGq0Bt0br7dx93175MYgkbkAlShCZXGqT9ffs/te7xff04jsgGq0Loqi0d+2x8q7/frYiYSaEQ2QBUaGqyI91boj7v99wqNyAYYCf15vp0vX/ZXaLNDwAM4dS+K6/3sNz7uF+uLhEbkAwyF/vhyXyy+3Rdx93jrP3oQxWYEwO38e9ZfKRLgcj6ZABgZUWTkJj42gcybuUSfOA/oC3/eb37rrQsKm8FuGpEPMBD6+vXjeJ1/Pfvz6c9zRPTb04c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sqK8q9GhCjvpUEVoxB+uzUB7A+7ppTnp7yhG+Ao9QSrO7FaEVc7A+enkA7+umOentKUf4CjxCKc3uloXu/v+N8FCXB/C+bpoTO3c8pRUImpQCkIXWzMHKIA1vuqYrPKKE2p5y4AFNKJX53bLQmjlYHb88gPd105zU7rQDfAUeodVm94tCl7bJrTCCk+ZANw10E+WN4A/gpDYhCs0allnTtXfKkhcc5xFkiWC6tr9VyApuYBJBc5oBKEKTruvilmjeRO0mlWoCpmtniv02ak1WaIVex8nq+A9N3C7n03XQhig0fdYrD+DPehynYLom7grAVfDTziECJ6vjPwDOP01z/l0WmvNQ+/G6LxkljeCFSwTTNXNXALprronAyer4D4Cz+2D0b+HkIb6jX97X3TbIuK5T07XdZMZU6OacQURORsd/BPhipnc0Z1h2o5YHFC6RmK7tQtNdc00knEyO/yYFjG8jIL+jCzuc/QuOcWn7/BUIpkRiurYLXbiJhJPN8Z8ALt+XbtbwryJ0YYezq05X4BFUiWi6JoSmKrRTTiEiJ5vjv0kAtlM3Xgb/ykgI/bD5MTr+Uz6f9/f0qfKOTlP+bds7FDqD478KPXkdF78rwKTi0o4cjv8q9GiWj+r4r0KPhD7q0yr0UZUd9dUJffeP0+hQfXqQGfhr5W3vNnvxj4+D9FXbGM3ATyvvpfkfo/61IhMiom4AAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$\\left[\\begin{matrix}a_{1 1} & a_{1 2} & a_{1 3} & a_{2 2} & a_{2 3} & a_{3 3} & 0 & 0 & 0 & 0\\\\0 & a_{1 1} & 0 & a_{1 2} & a_{1 3} & 0 & a_{2 2} & a_{2 3} & a_{3 3} & 0\\\\0 & 0 & a_{1 1} & 0 & a_{1 2} & a_{1 3} & 0 & a_{2 2} & a_{2 3} & a_{3 3}\\\\b_{1 1} & b_{1 2} & b_{1 3} & b_{2 2} & b_{2 3} & b_{3 3} & 0 & 0 & 0 & 0\\\\0 & b_{1 1} & 0 & b_{1 2} & b_{1 3} & 0 & b_{2 2} & b_{2 3} & b_{3 3} & 0\\\\0 & 0 & b_{1 1} & 0 & b_{1 2} & b_{1 3} & 0 & b_{2 2} & b_{2 3} & b_{3 3}\\\\0 & c_{1} & 0 & c_{2} & c_{3} & 0 & 0 & 0 & 0 & 0\\\\0 & 0 & c_{1} & 0 & c_{2} & c_{3} & 0 & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & c_{1} & 0 & 0 & c_{2} & c_{3} & 0\\\\0 & 0 & 0 & 0 & 0 & c_{1} & 0 & 0 & c_{2} & c_{3}\\end{matrix}\\right]$$"
      ],
      "text/plain": [
       "⎡a₁ ₁  a₁ ₂  a₁ ₃  a₂ ₂  a₂ ₃  a₃ ₃   0     0     0     0  ⎤\n",
       "⎢                                                          ⎥\n",
       "⎢ 0    a₁ ₁   0    a₁ ₂  a₁ ₃   0    a₂ ₂  a₂ ₃  a₃ ₃   0  ⎥\n",
       "⎢                                                          ⎥\n",
       "⎢ 0     0    a₁ ₁   0    a₁ ₂  a₁ ₃   0    a₂ ₂  a₂ ₃  a₃ ₃⎥\n",
       "⎢                                                          ⎥\n",
       "⎢b₁ ₁  b₁ ₂  b₁ ₃  b₂ ₂  b₂ ₃  b₃ ₃   0     0     0     0  ⎥\n",
       "⎢                                                          ⎥\n",
       "⎢ 0    b₁ ₁   0    b₁ ₂  b₁ ₃   0    b₂ ₂  b₂ ₃  b₃ ₃   0  ⎥\n",
       "⎢                                                          ⎥\n",
       "⎢ 0     0    b₁ ₁   0    b₁ ₂  b₁ ₃   0    b₂ ₂  b₂ ₃  b₃ ₃⎥\n",
       "⎢                                                          ⎥\n",
       "⎢ 0     c₁    0     c₂    c₃    0     0     0     0     0  ⎥\n",
       "⎢                                                          ⎥\n",
       "⎢ 0     0     c₁    0     c₂    c₃    0     0     0     0  ⎥\n",
       "⎢                                                          ⎥\n",
       "⎢ 0     0     0     0     c₁    0     0     c₂    c₃    0  ⎥\n",
       "⎢                                                          ⎥\n",
       "⎣ 0     0     0     0     0     c₁    0     0     c₂    c₃ ⎦"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix = mac.get_matrix()\n",
    "matrix"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Matrix $M$\n",
    "-----------"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Columns that are non reduced are kept. The rows which contain one if the $a_i$s is dropoed.\n",
    "$a_i$s are the coefficients of $x_i ^ {d_i}$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAFoAAAAyBAMAAAAuIdEGAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMA74lUMhAimXZEzWa73asFX9bSAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACQUlEQVRIDe2WP2gTURzHv73kEu7aNIJ/FpXeIHYSUwpOSitUhS6eILiId1s3DYpQtGp0qW5R3BsQ0almcxLqIAWnTqKLdgyKUBNbqILn7/feXd69uzcks/7gA+993ye/vLzkHsFE1MVgdTz6gb1zZwaTcXFuCvsGdFk7/Q/ZpeuL+41HszB5308tyDN5HLpbwDzljCrnAF4Bk+u+ID5B+yDKazj3HQIl40IbS7DC8RZDuehd3kalAZyiOaPqno+PqITFHYZiYY+sIZg12Ydg/0SlWdplEjvwMEPjXG+7iwJ9HhS2JbJ3UMP7QmiwexhrnYDYJm9V2m5j9LNl6I2XeLPp0aGQyEjb7hy5+shkX3lwttPEaB2C2OaXUeX2LWM8wVOBbk/RKpOp4rPpdwzFqd/3wpcOmGyNRNEWo9tZyzBP9TasZqP/dvZEkm/n8uH8Cif22w1tIT7BVS1UE3dTjWkU2z0tVJNqTY37tkMPh7FWfC2WvS19e8o4poY8krbbWdbfMpFWH95IhsoOnts7KLYgSC3bv/wgtJZugqGSvWd8dIt3N8Ckix72qncUX8H07Vvgy4BMJlXlFgLvA86HDOWy9ws4PZPt1rFS+4RrTaZv/wZdbobe1TbocgNtVBD33uX70WQ36UIF3YWS2P6GdbnnzL7H22N1wIpJ9n1puW207cXb1PZ1TGLT1GiL3PGcWYYm8kxEWthDryCyNT990mcoV3bpzp8Gk5UxEUUCzc5ZhkD1NizmomHt4f5xDPVv5i+476lodELMLAAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\left[\\begin{matrix}a_{1 1} & a_{2 2}\\\\b_{1 1} & b_{2 2}\\end{matrix}\\right]$$"
      ],
      "text/plain": [
       "⎡a₁ ₁  a₂ ₂⎤\n",
       "⎢          ⎥\n",
       "⎣b₁ ₁  b₂ ₂⎦"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.get_submatrix(matrix)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Second example\n",
    "-----------------\n",
    "This is from: http://isc.tamu.edu/resources/preprints/1996/1996-02.pdf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x, y, z = sym.symbols('x, y, z')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "a_0, a_1, a_2 = sym.symbols('a_0, a_1, a_2')\n",
    "b_0, b_1, b_2 = sym.symbols('b_0, b_1, b_2')\n",
    "c_0, c_1, c_2,c_3, c_4 = sym.symbols('c_0, c_1, c_2, c_3, c_4')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "f = a_0 * y -  a_1 * x + a_2 * z\n",
    "g = b_1 * x ** 2 + b_0 * y ** 2 - b_2 * z ** 2\n",
    "h = c_0 * y - c_1 * x ** 3 + c_2 * x ** 2 * z - c_3 * x * z ** 2 + c_4 * z ** 3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "polynomials = [f, g, h]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "mac = MacaulayResultant(polynomials, variables=[x, y, z])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAGMAAAAUBAMAAABrMp7fAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAdt3NMolEVO8Qq5lmIrurE6D6AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABF0lEQVQoFWMQMmEgBfAYJTCEYdfAu/udA7oMb2hcAQMrREvFBHRZhlkMrN/QBW8zsP+BaOFcvR5Ty0oGhg50LfIFDJ9gtshjamliYFjvgKYnI4HzMx4t9hMwtTDAHcbAgMUWoAX6mHZPCsBjCwMD21c0dzEwXNWegFcL0wIMLQysbXi17MbUAQzFCdB4weYXxg0YWu4yMLwvwKOlmoH3Apqm/xPwamHZwMCIrqUPGIoXELYAIwkFXAqNXsQw3wBF7AwD+0eo93f1Wx1gUJqAIm3///8nBiZNFDG23fsSYCEGkmBHdwZIsBZEoAKow0CCrKgyEF4ApiCSlomYsgycApiCSFoOYMoy8GARA2oRUsEijluIUSkBADifSkf5V5C+AAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$$\\left [ 1, \\quad 2, \\quad 3\\right ]$$"
      ],
      "text/plain": [
       "[1, 2, 3]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.degrees"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAPBAMAAAAv0UM9AAAALVBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAOrOgAAAADnRSTlMAMpndu3bvImbNiRBUq9OBhjcAAAAJcEhZcwAADsQAAA7EAZUrDhsAAABESURBVAgdY2BgYBACYgYGExDBmgIiK6aAyAUgkqMARG5lAJELQCSPAIjcxQAiz969++wqUIIBrIvhCYi55N0NEMXAAABbkhBrtxdTYQAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$4$$"
      ],
      "text/plain": [
       "4"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.degree_m"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "mac.get_monomials_set()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAABMAAAAPBAMAAAD0aukfAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAVO8Qq5l2zWYyiSK7RN2jbGmSAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAZUlEQVQIHWNgAAH2ZM5AIMWozMDA9P//AgYGk5DPQNEl2SBJNiCTBcTAZHakToCK8hhw/4UygdQ5BDN+A0SbOwPD+gsQpjoDQ7wBhBnAwPAcqnYrA4c2AwOr03cPBu4oV6A8AgAAADwbeTiD1lMAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$15$$"
      ],
      "text/plain": [
       "15"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.get_size()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {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WenxW0FLBBYxB8oyxQPOm/xTCZf0hQgjY59jcdzg6fzrvAOnOcTMSJa1NDWxXdipkTj4iQSwglyuJKnXPGlWl2LSlhY2eocqOdkgnAEdqbv99FaZs9HxS57YalVvnH4/XkOL181ZyINjW0FdKs2DnRSBMCS76EKPbrhDMuTrNrSfEbc4V9st91EZgG9NFO2pwHojQnt4Z+TblrLI45al05paDuRLTRjAo6btfOiUaaENhgGlHs14Wt0yzrp1OCxnBUeY0uCs6DR2eX832U5tyuVyE27Zmf3W5dOU4kXzUnok0NzUKqFTsnGmlCYAMJUezXCWdcnGbXkBI0hqPKjQrqFrwhTyB8170hh7hlWpzArRsVh3FTwF3Ud/9f96aY5/8+RLt/3386MpnwpE06aQAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\left [ x^{4}, \\quad x^{3} y, \\quad x^{3} z, \\quad x^{2} y^{2}, \\quad x^{2} y z, \\quad x^{2} z^{2}, \\quad x y^{3}, \\quad x y^{2} z, \\quad x y z^{2}, \\quad x z^{3}, \\quad y^{4}, \\quad y^{3} z, \\quad y^{2} z^{2}, \\quad y z^{3}, \\quad z^{4}\\right ]$$"
      ],
      "text/plain": [
       "⎡ 4   3     3     2  2   2       2  2     3     2         2     3   4   3     \n",
       "⎣x , x ⋅y, x ⋅z, x ⋅y , x ⋅y⋅z, x ⋅z , x⋅y , x⋅y ⋅z, x⋅y⋅z , x⋅z , y , y ⋅z, y\n",
       "\n",
       "2  2     3   4⎤\n",
       " ⋅z , y⋅z , z ⎦"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.monomial_set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA1EAAAAbBAMAAABvgBgOAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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nGZonZ/rG4cKU7AE12e/zZUi8FgeJ58ZTAXZUBUgnTCrVw7CjEwUXLGnHDaTcolZOzxpTnOykqqZlN5ebVJOcs9b2FPeBXyd4s5h9pJqrd1XJU5MSd/5quF7EpB6al+n/tkhqkYkq/x3FJH4vQaLPf2vJtU2v/Wzj/+PQgfq7TsLPuOoZL/3k7Bd+BTVcuZCe/5vxnYjqFpiV+sAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$\\left [ \\left [ x^{3}, \\quad x^{2} y, \\quad x^{2} z, \\quad x y^{2}, \\quad x y z, \\quad x z^{2}, \\quad y^{3}, \\quad y^{2} z, \\quad y z^{2}, \\quad z^{3}\\right ], \\quad \\left [ y^{2}, \\quad y z, \\quad z^{2}\\right ], \\quad \\left [ y, \\quad z\\right ]\\right ]$$"
      ],
      "text/plain": [
       "⎡⎡ 3   2     2       2            2   3   2       2   3⎤  ⎡ 2        2⎤       \n",
       "⎣⎣x , x ⋅y, x ⋅z, x⋅y , x⋅y⋅z, x⋅z , y , y ⋅z, y⋅z , z ⎦, ⎣y , y⋅z, z ⎦, [y, z\n",
       "\n",
       " ⎤\n",
       "]⎦"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.get_row_coefficients()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0MAAAF3CAMAAABQamBPAAAANlBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABHL6OuAAAAEXRSTlMAMquZdlQQQN0iRM2J72a7fJC/CQQAAAAJcEhZcwAADsQAAA7EAZUrDhsAACAASURBVHgB7V3hYqrMEsOq/dpT217f/2XvLjvAYhGTKCuL448D4oSZyWyq2JLT7M7t463xhzPgDDAMfCTpNM3uvD+Ex5EBe6wz4Aw0P1E4b+eooZ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& 0 & 0 & 0 & - a_{1} & 0 & 0 & 0 & a_{0} & a_{2} & 0 & 0 & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 0 & - a_{1} & 0 & 0 & 0 & a_{0} & a_{2} & 0 & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & - a_{1} & 0 & 0 & 0 & a_{0} & a_{2} & 0\\\\0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & - a_{1} & 0 & 0 & 0 & a_{0} & a_{2}\\\\0 & 0 & 0 & b_{1} & 0 & 0 & 0 & 0 & 0 & 0 & b_{0} & 0 & - b_{2} & 0 & 0\\\\0 & 0 & 0 & 0 & b_{1} & 0 & 0 & 0 & 0 & 0 & 0 & b_{0} & 0 & - b_{2} & 0\\\\0 & 0 & 0 & 0 & 0 & b_{1} & 0 & 0 & 0 & 0 & 0 & 0 & b_{0} & 0 & - b_{2}\\\\0 & - c_{1} & 0 & 0 & c_{2} & 0 & 0 & 0 & - c_{3} & 0 & 0 & 0 & 0 & c_{4} & 0\\\\0 & 0 & - c_{1} & 0 & 0 & c_{2} & 0 & 0 & 0 & - c_{3} & 0 & 0 & 0 & 0 & c_{4}\\end{array}\\right]$$"
      ],
      "text/plain": [
       "⎡-a₁  a₀   a₂    0    0    0    0    0    0    0   0   0    0    0    0 ⎤\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0   -a₁   0   a₀   a₂    0    0    0    0    0   0   0    0    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0   -a₁   0   a₀   a₂    0    0    0    0   0   0    0    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0   -a₁   0    0   a₀   a₂    0    0   0   0    0    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0   -a₁   0    0   a₀   a₂    0   0   0    0    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0    0   -a₁   0    0   a₀   a₂   0   0    0    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0    0    0   -a₁   0    0    0   a₀  a₂   0    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0    0    0    0   -a₁   0    0   0   a₀  a₂    0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0    0    0    0    0   -a₁   0   0   0   a₀   a₂    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0    0    0    0    0    0   -a₁  0   0    0   a₀   a₂ ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0   b₁    0    0    0    0    0    0   b₀  0   -b₂   0    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0   b₁    0    0    0    0    0   0   b₀   0   -b₂   0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0    0    0    0    0   b₁    0    0    0    0   0   0   b₀    0   -b₂⎥\n",
       "⎢                                                                       ⎥\n",
       "⎢ 0   -c₁   0    0   c₂    0    0    0   -c₃   0   0   0    0   c₄    0 ⎥\n",
       "⎢                                                                       ⎥\n",
       "⎣ 0    0   -c₁   0    0   c₂    0    0    0   -c₃  0   0    0    0   c₄ ⎦"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix = mac.get_matrix()\n",
    "matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAFMAAAAUBAMAAAADwRznAAAAMFBMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAv3aB7AAAAD3RSTlMAIma7zZnddlTvRIkQqzLsm4+cAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABZElEQVQoFY2TP0jDQBTGv7SJtiYpAamr0UUcdXByiJODCBkFrc0g4urQTdDVUXASoZmcu4hT8TZxEKRYxMku7gqdVIjvXf5wVwX7IC/fe/e73Lu7F8DwMYbNMTOdgevi7SST+ss8qm3B9Si5Rs+pANrJl45wVLkEqknSgRMApRBO/1UAG888UbeHxjdgdg8pewNMMHAsgEedSqNJQl0p74EZFmOgZoxWjvYWduV0zcmvzrcGgB1iOUdXMRtrGAeMloXxSXsKcMAZLoByETndGCVbobOIcMEyRa0P1pplaNND7b1A3QA2rTNijD4BtzGjeQHVAFa6mkozeg40BaaiYlsWHXGgUlIzGgJ7clvXnKJajRCLnjMcgRmto3QGWB1c0WCjvemj3t0B9oXGWi/DHoztPmXNQXqxxXjldx9kY3Sr1C6K2YrWJbULltTUnRqompuwaG054Ev/hytzZYZP7l+jH+YH96tTwlcb7qAAAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$\\left ( 15, \\quad 15\\right )$$"
      ],
      "text/plain": [
       "(15, 15)"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "matrix.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAOAAAABkCAMAAACo0swdAAAAP1BMVEX///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADFBd4eAAAAFHRSTlMAMquZdlQQQO0wRM3dIonvZrt8bPfhUawAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAU5SURBVHgB7ZzZeqMwDIXN2k5YM8P7P+t4abFIrFMjtobAReuYHEu/ZRN6yheVDPZI1cmO2nEplQxZro/iZHyqN1TpYACTs7F5nv4UgGXW9m24SucArPT2KuvG1823TgHYdwaorTyWb50C8G4/AIqh9Fxj6xSAgwW8DaHPgR8Am6zN8i40M+MUTRuzBd9ysVDvviEzo9yG/Hsw8hsD3jq9cSt9odVHElziZCjTJIK8zduHs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WGvfePJo64xljFx5FZJeo3PhFNmxgPmjXBo4xD7iJDUtpQu31HWMACNzUUG6+TyzUa3TuM8YuKogIAH3GB7VWcYx/NeAajvHvBVzJMf69gCvtiwtwpYk8bJirgodN/UqBrwquNJGHDfPOFQRuKq7H/kKQD6ggcFPBgPrU/kKQDw+I3FQw4ALjVxwRpcMDIjcVjaj2F6J0eEDkpqIR5cavOCJKhwWcZY7RCPsLXXTGMWYBxf7t/kILyDnGAHBv43cbx5gF3H+lzYoY7RizgF/XivD3J9A999QWG79ioU6BdYx5QOSmPkHRjv2FyDHmAcX+7f5CAzh+yYSea2rH8YAHGL/gwV26REJt1jEGgMBNDYXwffsLgWMMAH3Gr9aKXKKvhuXzLYhjfMIKTh3jEwL6SprWBTidj9d75Sp48m+ILc03qebui41er0R8xvYbYvNc/QfUHU15fLswzwAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\left[\\begin{matrix}- a_{1} & a_{0} & a_{2} & 0\\\\0 & - a_{1} & 0 & 0\\\\0 & 0 & - a_{1} & 0\\\\0 & 0 & 0 & - a_{1}\\end{matrix}\\right]$$"
      ],
      "text/plain": [
       "⎡-a₁  a₀   a₂    0 ⎤\n",
       "⎢                  ⎥\n",
       "⎢ 0   -a₁   0    0 ⎥\n",
       "⎢                  ⎥\n",
       "⎢ 0    0   -a₁   0 ⎥\n",
       "⎢                  ⎥\n",
       "⎣ 0    0    0   -a₁⎦"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mac.get_submatrix(mac.get_matrix())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [conda env:sympy]",
   "language": "python",
   "name": "conda-env-sympy-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
